﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace HouseAgencySite.Utils
{
    /// <summary>
    /// 发送邮件
    /// </summary>
    public class SmtpSending:SmtpSendingBase
    {
        static string PortalAlias = ConfigurationManager.AppSettings["SiteUrl"].ToString();
        public void SimpleSendShouldSucceed(string subject, string messageText)
        {

            CreateSender().Send(From, To, subject, messageText);

        }

        public void HtmlMessageSendShouldSucceed(string subject, string messageText)
        {

            //var msg = new Message(From, To, "TEST: html message",
            //                      "<a href=\"http://emailsender.codeplex.com\">Email Sender at Codeplex</a>. That should be an anchor") { Format = Format.Html };
            var msg = new Message(From, To, subject, string.Format("<a href=\""+PortalAlias+"/Admin/Account/ChangePassWord?email={0}\">点击此处修改密码</a>" , messageText)) { Format = Format.Html, Encoding=System.Text.Encoding.UTF8 };
            CreateSender().Send(msg);

        }

    }
}